import React, {PureComponent} from 'react'
import { View, Text } from 'react-native'

const WithFooter = (WrappedComponent) => {
  return class WrappedFooter extends PureComponent {
    constructor(props) {
      super(props)
    }

    render() {
      return (
        <>
          {/* 传入组件 */}
          <WrappedComponent {...this.props} />

          {/* 在组件后方，添加页脚信息 */}
          <View style={{flex:1, justifyContent: 'center', alignItems: 'center'}}>
            <Text style={{textAlign: 'center', paddingVertical: 20}}>
            &copy;2021 版权所有 lagou.com
            </Text>
          </View>
        </>
      )
    }
  }
  
}

export default WithFooter
